home *** CD-ROM | disk | FTP | other *** search
-
- Function ElemInList (TheList As Control, Match$, Index%) As Integer
- Cnt% = TheList.ListCount
- i% = 0
- Found = FALSE
- Do While (i% < Cnt%) And (Found = FALSE)
- If TheList.List(i%) = Match$ Then
- Found = TRUE
- Exit Do
- End If
- i% = i% + 1
- Loop
-
- If Found Then
- Index% = i%
- ElemInList = TRUE
- Else
- Index% = -1
- ElemInList = FALSE
- End If
- End Function
-
- Sub ResetLB (ThisControl As Control)
- hLB% = ControlHwnd(ThisControl)
- x% = SendMessage%(hLB%, LB_RESETCONTENT, 0, 0&)
- End Sub
-
- Function DblAmpersand$ (S$)
- T$ = S$
- i% = InStr(T$, "&")
- While i% <> 0
- T$ = Left$(T$, i%) + "&" + Right$(T$, Len(T$) - i%)
- i% = InStr(i% + 2, T$, "&")
- Wend
- DblAmpersand$ = T$
- End Function
-
- Sub LBAddDirList (hLB%, Attr%, FileSpec As String)
- rc& = SendMessage(hLB%, LB_DIR, Attr%, FileSpec)
- End Sub
-
- Function LBSelectString% (hLB%, Start%, Prefix As String)
- LBSelectString = SendMessage(hLB%, LB_SELECTSTRING, Start%, Prefix)
- End Function
-
- Function LBSetTopIndex% (Ctrl As Control, Indx%)
- Ctrl.ListIndex = Ctrl.ListCount - 1
- Ctrl.ListIndex = Indx%
- End Function
-
- Function LBSetCurSel% (hLB%, Indx%)
- LBSetCurSel = SendMessage(hLB%, LB_SETCURSEL, Indx%, 0&)
- End Function
-
- Sub LBResetContent (hLB%)
- rc& = SendMessage(hLB%, LB_RESETCONTENT, 0, 0&)
- End Sub
-
- Function LBSetTabStops (hLB%, Tabs() As Integer)
- num% = UBound(Tabs) - LBound(Tabs)
- LBSetTabStops = SendMessage(hLB%, LB_SETTABSTOPS, num%, Tabs(1))
- End Function
-
- Function LBFindString% (hLB%, Start%, Prefix As String)
- If Right$(Prefix, 1) <> Chr$(0) Then Prefix = Prefix + Chr$(0)
- LBFindString = SendMessage(hLB%, LB_FINDSTRING, Start%, Prefix)
- End Function
-
- Sub Make_Password_Control (EditControl As Control, PasswordMask As Integer)
- ' PasswordMask is the ASC value of the char to use as the mask
- Dim StyleFlags As Long
- EditControl.SetFocus
- hWnd = GetFocus()
- StyleFlags = GetWindowLong(hWnd, GWL_STYLE)
- StyleFlags = StyleFlags Or ES_PASSWORD
- StyleFlags = SetWindowLong(hWnd, GWL_STYLE, StyleFlags)
- StyleFlags = SendMessage(hWnd, EM_SETPASSWORDCHAR, PasswordMask, 0&)
- End Sub
-
- Sub CBResetContent (hCB%)
- rc& = SendMessage(hCB%, CB_RESETCONTENT, 0, 0&)
- End Sub
-
- Sub CBSelectString (LB As Control, Prefix As String)
- Found = FALSE
- i% = 0
- While (Not Found) And (i% < LB.ListCount)
- If LB.List(i%) = Prefix Then Found = TRUE
- i% = i% + 1
- Wend
- If Found Then LB.ListIndex = (i% - 1) Else LB.ListIndex = -1
- End Sub
-
-